<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>ajax</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/qs/6.10.1/qs.min.js"></script>
  <script>
    var data = {
      qq: '1024543289'
    }
    var qs = Qs;
    // 1.创建一个xhr实例对象
    var xhr = new XMLHttpRequest();
    // 2.设置请求头，打开请求连接
    xhr.open('post','https://api.muxiaoguo.cn/api/QqInfo')
    // 2.1修改post请求的请求头：Content-Type:x-www-form-urlencoded
    xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded')
    // 3.设置请求体，并发送请求
    xhr.send(qs.stringify(data));
    // 4.监听连接状态的改变，做出相应
    xhr.onreadystatechange = function() {
      if(xhr.readyState === 4 && xhr.status === 200){
        console.log(xhr.response);
      }
    }
  </script>
</head>
<body>
  
</body>
</html>